.class public abstract Les/qv;
.super Ljava/lang/Object;
.source "FileHandler.java"

# interfaces
.implements Les/tv;


# instance fields
.field private final a:Les/ew;

.field private final b:Ljava/util/concurrent/atomic/AtomicBoolean;

.field private final c:Ljava/lang/ThreadLocal;
    .annotation system Ldalvik/annotation/Signature;
        value = {
            "Ljava/lang/ThreadLocal<",
            "Ljava/util/Map<",
            "Ljava/lang/String;",
            "Les/ev;",
            ">;>;"
        }
    .end annotation
.end field


# direct methods
.method public constructor <init>(ILjava/lang/String;)V
    .locals 0

    .line 1
    invoke-direct {p0}, Ljava/lang/Object;-><init>()V

    .line 2
    new-instance p1, Les/ew;

    invoke-direct {p1, p2}, Les/ew;-><init>(Ljava/lang/String;)V

    iput-object p1, p0, Les/qv;->a:Les/ew;

    .line 3
    new-instance p1, Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 p2, 0x0

    invoke-direct {p1, p2}, Ljava/util/concurrent/atomic/AtomicBoolean;-><init>(Z)V

    iput-object p1, p0, Les/qv;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    .line 4
    new-instance p1, Les/qv$a;

    invoke-direct {p1, p0}, Les/qv$a;-><init>(Les/qv;)V

    iput-object p1, p0, Les/qv;->c:Ljava/lang/ThreadLocal;

    return-void
.end method

.method private a()V
    .locals 6

    .line 40
    iget-object v0, p0, Les/qv;->c:Ljava/lang/ThreadLocal;

    invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map;

    .line 41
    invoke-interface {v0}, Ljava/util/Map;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_1

    .line 42
    invoke-interface {v0}, Ljava/util/Map;->entrySet()Ljava/util/Set;

    move-result-object v1

    .line 43
    invoke-interface {v1}, Ljava/util/Set;->iterator()Ljava/util/Iterator;

    move-result-object v1

    :goto_0
    invoke-interface {v1}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_0

    invoke-interface {v1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/util/Map$Entry;

    .line 44
    invoke-interface {v2}, Ljava/util/Map$Entry;->getValue()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Les/ev;

    const/4 v3, 0x3

    .line 45
    invoke-virtual {v2, v3}, Les/ev;->e(I)V

    .line 46
    iget-object v3, p0, Les/qv;->a:Les/ew;

    invoke-virtual {v2}, Les/dv;->k()J

    move-result-wide v4

    invoke-virtual {v3, v4, v5}, Les/dw;->a(J)V

    goto :goto_0

    .line 47
    :cond_0
    invoke-interface {v0}, Ljava/util/Map;->clear()V

    :cond_1
    return-void
.end method

.method private a(Les/gv;Les/ev;)Z
    .locals 0

    if-nez p2, :cond_0

    const/4 p1, 0x0

    return p1

    .line 48
    :cond_0
    invoke-virtual {p0, p2}, Les/qv;->a(Les/ev;)Z

    move-result p1

    return p1
.end method

.method private b(Les/ev;)I
    .locals 6

    .line 23
    iget-object v0, p0, Les/qv;->c:Ljava/lang/ThreadLocal;

    invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map;

    const/4 v1, 0x1

    if-eqz v0, :cond_1

    .line 24
    invoke-virtual {p1}, Les/dv;->e()Ljava/lang/String;

    move-result-object v2

    invoke-interface {v0, v2}, Ljava/util/Map;->remove(Ljava/lang/Object;)Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Les/ev;

    if-eqz v0, :cond_1

    .line 25
    invoke-virtual {v0}, Les/dv;->d()J

    move-result-wide v1

    invoke-virtual {p1}, Les/dv;->d()J

    move-result-wide v3

    cmp-long v5, v1, v3

    if-nez v5, :cond_0

    const/4 p1, 0x0

    return p1

    .line 26
    :cond_0
    invoke-virtual {v0}, Les/dv;->k()J

    move-result-wide v0

    invoke-virtual {p1, v0, v1}, Les/dv;->d(J)V

    const/4 p1, 0x2

    return p1

    :cond_1
    return v1
.end method

.method private b(Les/gv;)V
    .locals 3

    .line 16
    invoke-virtual {p1}, Les/fv;->a()I

    move-result v0

    const/4 v1, 0x2

    if-ne v0, v1, :cond_0

    .line 17
    iget-object v0, p0, Les/qv;->a:Les/ew;

    invoke-virtual {p1}, Les/gv;->g()J

    move-result-wide v1

    invoke-virtual {v0, v1, v2}, Les/ew;->b(J)Ljava/util/List;

    move-result-object p1

    .line 18
    iget-object v0, p0, Les/qv;->c:Ljava/lang/ThreadLocal;

    invoke-virtual {v0}, Ljava/lang/ThreadLocal;->get()Ljava/lang/Object;

    move-result-object v0

    check-cast v0, Ljava/util/Map;

    .line 19
    invoke-interface {v0}, Ljava/util/Map;->clear()V

    if-eqz p1, :cond_0

    .line 20
    invoke-interface {p1}, Ljava/util/List;->isEmpty()Z

    move-result v1

    if-nez v1, :cond_0

    .line 21
    invoke-interface {p1}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object p1

    :goto_0
    invoke-interface {p1}, Ljava/util/Iterator;->hasNext()Z

    move-result v1

    if-eqz v1, :cond_0

    invoke-interface {p1}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v1

    check-cast v1, Les/dv;

    .line 22
    invoke-virtual {v1}, Les/dv;->e()Ljava/lang/String;

    move-result-object v2

    check-cast v1, Les/ev;

    invoke-interface {v0, v2, v1}, Ljava/util/Map;->put(Ljava/lang/Object;Ljava/lang/Object;)Ljava/lang/Object;

    goto :goto_0

    :cond_0
    return-void
.end method

.method private c(Les/hv;)Z
    .locals 2

    .line 1
    invoke-virtual {p1}, Les/hv;->h()Les/dv;

    move-result-object p1

    const/4 v0, 0x0

    if-nez p1, :cond_0

    return v0

    .line 2
    :cond_0
    instance-of v1, p1, Les/ev;

    if-eqz v1, :cond_1

    .line 3
    check-cast p1, Les/ev;

    .line 4
    invoke-virtual {p0, p1}, Les/qv;->a(Les/ev;)Z

    move-result p1

    return p1

    :cond_1
    return v0
.end method


# virtual methods
.method public a(Les/bv;)V
    .locals 9

    .line 2
    invoke-virtual {p1}, Les/bv;->h()Ljava/util/List;

    move-result-object v0

    if-eqz v0, :cond_8

    .line 3
    invoke-interface {v0}, Ljava/util/List;->isEmpty()Z

    move-result v1

    if-eqz v1, :cond_0

    goto/16 :goto_2

    .line 4
    :cond_0
    new-instance v1, Ljava/lang/StringBuilder;

    const-string v2, "pid IN ("

    invoke-direct {v1, v2}, Ljava/lang/StringBuilder;-><init>(Ljava/lang/String;)V

    .line 5
    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_1

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Ljava/lang/Long;

    invoke-virtual {v2}, Ljava/lang/Long;->longValue()J

    move-result-wide v2

    .line 6
    invoke-virtual {v1, v2, v3}, Ljava/lang/StringBuilder;->append(J)Ljava/lang/StringBuilder;

    const/16 v2, 0x2c

    invoke-virtual {v1, v2}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    goto :goto_0

    .line 7
    :cond_1
    invoke-virtual {v1}, Ljava/lang/StringBuilder;->length()I

    move-result v0

    const/4 v2, 0x1

    sub-int/2addr v0, v2

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->length()I

    move-result v3

    invoke-virtual {v1, v0, v3}, Ljava/lang/StringBuilder;->delete(II)Ljava/lang/StringBuilder;

    const/16 v0, 0x29

    .line 8
    invoke-virtual {v1, v0}, Ljava/lang/StringBuilder;->append(C)Ljava/lang/StringBuilder;

    .line 9
    new-instance v0, Landroid/content/ContentValues;

    invoke-direct {v0}, Landroid/content/ContentValues;-><init>()V

    .line 10
    invoke-virtual {p1}, Les/fv;->a()I

    move-result v3

    const/16 v4, 0xf

    const-string v5, "isLogPath"

    const-string v6, "groupname"

    if-ne v3, v4, :cond_2

    .line 11
    invoke-virtual {p1}, Les/bv;->g()Ljava/lang/String;

    move-result-object p1

    invoke-virtual {v0, v6, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 12
    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {v0, v5, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_1

    :cond_2
    const/16 v4, 0x10

    const/4 v7, 0x0

    if-ne v3, v4, :cond_3

    const/4 p1, 0x0

    .line 13
    invoke-virtual {v0, v6, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 14
    invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {v0, v5, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_1

    :cond_3
    const/16 v4, 0xb

    const-string v8, "isNomedia"

    if-ne v3, v4, :cond_4

    .line 15
    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {v0, v8, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_1

    :cond_4
    const/16 v4, 0xc

    if-ne v3, v4, :cond_5

    .line 16
    invoke-static {v7}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {v0, v8, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_1

    :cond_5
    const/16 v4, 0xd

    if-ne v3, v4, :cond_6

    const-string p1, "Download"

    .line 17
    invoke-virtual {v0, v6, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 18
    invoke-static {v2}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {v0, v5, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    goto :goto_1

    :cond_6
    const/16 v2, 0xe

    if-ne v3, v2, :cond_8

    .line 19
    invoke-virtual {p1}, Les/fv;->b()Ljava/lang/String;

    move-result-object v2

    .line 20
    invoke-virtual {p1}, Les/fv;->f()Z

    move-result p1

    if-eqz v2, :cond_7

    .line 21
    invoke-virtual {v0, v6, v2}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/String;)V

    .line 22
    :cond_7
    invoke-static {p1}, Ljava/lang/Integer;->valueOf(I)Ljava/lang/Integer;

    move-result-object p1

    invoke-virtual {v0, v5, p1}, Landroid/content/ContentValues;->put(Ljava/lang/String;Ljava/lang/Integer;)V

    .line 23
    :goto_1
    iget-object p1, p0, Les/qv;->a:Les/ew;

    invoke-virtual {v1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object v1

    invoke-virtual {p1, v1, v0}, Les/dw;->a(Ljava/lang/String;Landroid/content/ContentValues;)V

    :cond_8
    :goto_2
    return-void
.end method

.method public final a(Les/gv;)V
    .locals 5

    .line 28
    invoke-virtual {p1}, Les/fv;->e()Z

    move-result v0

    const/4 v1, 0x1

    if-eqz v0, :cond_1

    .line 29
    iget-object p1, p0, Les/qv;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v0, 0x0

    invoke-virtual {p1, v1, v0}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z

    move-result p1

    if-eqz p1, :cond_0

    .line 30
    iget-object p1, p0, Les/qv;->a:Les/ew;

    const/4 v0, 0x0

    invoke-virtual {p1, v0}, Les/ew;->b(Les/dw$c;)V

    :cond_0
    return-void

    .line 31
    :cond_1
    invoke-direct {p0, p1}, Les/qv;->b(Les/gv;)V

    .line 32
    invoke-virtual {p1}, Les/gv;->h()Ljava/util/List;

    move-result-object v0

    invoke-interface {v0}, Ljava/util/List;->iterator()Ljava/util/Iterator;

    move-result-object v0

    :cond_2
    :goto_0
    invoke-interface {v0}, Ljava/util/Iterator;->hasNext()Z

    move-result v2

    if-eqz v2, :cond_4

    invoke-interface {v0}, Ljava/util/Iterator;->next()Ljava/lang/Object;

    move-result-object v2

    check-cast v2, Les/ev;

    .line 33
    invoke-direct {p0, p1, v2}, Les/qv;->a(Les/gv;Les/ev;)Z

    move-result v3

    if-eqz v3, :cond_2

    .line 34
    iget-object v3, p0, Les/qv;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    invoke-virtual {v3, v1}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 35
    invoke-direct {p0, v2}, Les/qv;->b(Les/ev;)I

    move-result v3

    .line 36
    invoke-virtual {v2, v3}, Les/ev;->e(I)V

    if-ne v3, v1, :cond_3

    .line 37
    iget-object v3, p0, Les/qv;->a:Les/ew;

    invoke-virtual {v3, v2}, Les/dw;->a(Les/dv;)J

    goto :goto_0

    :cond_3
    const/4 v4, 0x2

    if-ne v3, v4, :cond_2

    .line 38
    iget-object v3, p0, Les/qv;->a:Les/ew;

    invoke-virtual {v3, v2}, Les/dw;->b(Les/dv;)V

    goto :goto_0

    .line 39
    :cond_4
    invoke-direct {p0}, Les/qv;->a()V

    return-void
.end method

.method public final a(Les/hv;)V
    .locals 3

    .line 24
    invoke-virtual {p1}, Les/fv;->e()Z

    move-result v0

    if-eqz v0, :cond_1

    .line 25
    iget-object v0, p0, Les/qv;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v1, 0x1

    const/4 v2, 0x0

    invoke-virtual {v0, v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->compareAndSet(ZZ)Z

    move-result v0

    if-eqz v0, :cond_0

    .line 26
    iget-object v0, p0, Les/qv;->a:Les/ew;

    invoke-virtual {p1}, Les/hv;->g()Les/dw$c;

    move-result-object p1

    invoke-virtual {v0, p1}, Les/ew;->b(Les/dw$c;)V

    :cond_0
    return-void

    .line 27
    :cond_1
    invoke-virtual {p0, p1}, Les/qv;->b(Les/hv;)V

    return-void
.end method

.method public a(Z)V
    .locals 0

    if-eqz p1, :cond_0

    .line 1
    iget-object p1, p0, Les/qv;->a:Les/ew;

    invoke-virtual {p1}, Les/dw;->c()V

    :cond_0
    return-void
.end method

.method protected abstract a(Les/ev;)Z
.end method

.method protected b(Les/hv;)V
    .locals 6

    .line 1
    invoke-virtual {p1}, Les/fv;->d()Ljava/lang/String;

    move-result-object v0

    .line 2
    invoke-direct {p0, p1}, Les/qv;->c(Les/hv;)Z

    move-result v1

    if-nez v1, :cond_0

    return-void

    .line 3
    :cond_0
    iget-object v1, p0, Les/qv;->b:Ljava/util/concurrent/atomic/AtomicBoolean;

    const/4 v2, 0x1

    invoke-virtual {v1, v2}, Ljava/util/concurrent/atomic/AtomicBoolean;->set(Z)V

    .line 4
    invoke-virtual {p1}, Les/hv;->h()Les/dv;

    move-result-object v1

    check-cast v1, Les/ev;

    .line 5
    invoke-virtual {p1}, Les/fv;->a()I

    move-result v3

    const/4 v4, 0x3

    if-ne v3, v4, :cond_1

    .line 6
    iget-object p1, p0, Les/qv;->a:Les/ew;

    invoke-virtual {p1, v1}, Les/ew;->a(Les/ev;)V

    goto :goto_0

    .line 7
    :cond_1
    invoke-virtual {p1}, Les/fv;->a()I

    move-result v3

    if-eqz v3, :cond_3

    .line 8
    new-instance v3, Ljava/io/File;

    invoke-direct {v3, v0}, Ljava/io/File;-><init>(Ljava/lang/String;)V

    .line 9
    invoke-virtual {v3}, Ljava/io/File;->length()J

    move-result-wide v4

    invoke-virtual {v1, v4, v5}, Les/ev;->g(J)V

    .line 10
    invoke-virtual {v3}, Ljava/io/File;->lastModified()J

    move-result-wide v4

    invoke-virtual {v1, v4, v5}, Les/dv;->a(J)V

    .line 11
    invoke-virtual {p1}, Les/fv;->a()I

    move-result p1

    if-ne p1, v2, :cond_2

    .line 12
    invoke-virtual {v3}, Ljava/io/File;->lastModified()J

    move-result-wide v2

    invoke-virtual {v1, v2, v3}, Les/dv;->c(J)V

    .line 13
    iget-object p1, p0, Les/qv;->a:Les/ew;

    invoke-virtual {p1, v1}, Les/ew;->b(Les/ev;)V

    goto :goto_0

    .line 14
    :cond_2
    new-instance p1, Ljava/lang/StringBuilder;

    invoke-direct {p1}, Ljava/lang/StringBuilder;-><init>()V

    const-string v2, "sync old file:"

    invoke-virtual {p1, v2}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1, v0}, Ljava/lang/StringBuilder;->append(Ljava/lang/String;)Ljava/lang/StringBuilder;

    invoke-virtual {p1}, Ljava/lang/StringBuilder;->toString()Ljava/lang/String;

    move-result-object p1

    const-string v0, "FileHandler"

    invoke-static {v0, p1}, Lcom/estrongs/android/util/n;->a(Ljava/lang/String;Ljava/lang/String;)V

    .line 15
    iget-object p1, p0, Les/qv;->a:Les/ew;

    invoke-virtual {p1, v1}, Les/ew;->c(Les/ev;)V

    :cond_3
    :goto_0
    return-void
.end method
